const { Tray } = require('electron')
const createTray = (app,win) => {
  const tray = new Tray('icon@2x.png')
  tray.setToolTip('readit')
  tray.on('click', (e) => {
    if (e.shiftKey) {
      app.quit()
    } else {
      win.isVisible() ? win.hide() : win.show()
    }
  })
}
module.exports = createTray